w,h = map(int,input().split())
t = int(input())
flag = [[0]*(h+1) for _ in range(w+1)] # flag[i][j]代表是否清理过
cnt = 0
for _ in range(t):
    r1, c1, r2, c2 = map(int,input().split())
    for i in range(r1,r2+1):
        for j in range(c1,c2+1):
            if flag[i][j] == 0:
                flag[i][j] = 1
                cnt += 1 # 清理过的草坪+1
                
print(w*h-cnt) # 剩余未清理的草坪